import { Form } from 'antd';
import styles from './index.less';

const finishFailed = errors => {
    console.log(errors);
}

const layout = {
    labelCol: { span: 8 },
    wrapperCol: { span: 16 }
}

const TableListForm = ({ onFinish, children, initialValues, onFinishFailed = finishFailed, layout=layout }) => {

    return (
        <div className={styles.tableListForm}>
            <Form
                {...layout}
                layout="inline"
                initialValues={{...initialValues}}
                onFinish={onFinish}
                onFinishFailed={onFinishFailed}
            >
                {children}
            </Form>
        </div>
    )
}

export default TableListForm;